Page({
  data: {
    countDownVisible: true,
    time: 10,
  },

  onLoad() {
    // 获取页面栈
    const pageStack = getCurrentPages();
    console.log(pageStack);
  },

  getSMSCode() {
    // 显示倒计时组件
    this.setData({
      countDownVisible: true,
    });
  },

  countdownChange(ev) {
    // console.log("事件被触发了...");
    // console.log(ev.detail);
    // 渲染数据
    this.setData({ time: ev.detail });
    // 隐藏倒计时组件
    if (ev.detail === 0) {
      this.setData({ countDownVisible: false, time: 10 });
    }
  },
});
